{template 'common/header'}
<div id="louie-list" class="row" data-url="{php echo $this->createWebUrl('api')}" data-admin-url="{php echo murl('entry//admin',array('m'=>'kuyuan_vbz'),true,true);}">
    <div id="louie-header">
        <h6>活动列表</h6>
        <a href="{php echo $this->createWebUrl('edit')}" class="btn btn-default btn-sm header-right-btn">创建活动</a>
    </div>

    <ul class="nav nav-tabs" style="margin: 10px 0;">
        <li v-for="(item,index) in nav" v-bind:class="item.active ? 'active' : ''" v-on:click="changeNav(index)"><a href="javascript:;">{{item.name}}</a></li>
    </ul>

    <!--S搜索-->
    <div id="search-activity" class="form-group">
        <input type="text" v-model="search_keyword" class="form-control" placeholder="搜索内容" />
        <select class="form-control" v-model="search_type">
            <option value="id">搜索id</option>
            <option value="name">搜索活动名</option>
            <option value="address">搜索活动地址</option>
        </select>
        <button type="button" class="btn btn-default" @click="searchSubmit">搜索</button>
    </div>
    <!--E搜索-->

    <table class="table table-bordered table-hover" v-if="list.length > 0">
        <tr><th>id</th><th>活动名</th><th>活动响应词</th><th>状态</th><th>已用资金/投入资金</th><th>开始时间/结束时间</th><th>活动地址</th><th>管理</th><th>操作</th></tr>
        <tr v-for="item in list">
            <td>{{item.id}}</td>
            <td>{{item.name ? item.name : '待设置'}}</td>
            <td>{{item.response_keyword ? item.response_keyword : '待设置'}}</td>
            <td>
                <span v-if="nav[nav_index].name == '待审核'">
                    <button class="btn btn-primary btn-xs" @click="checkActivity(item.id)">{{nav[nav_index].name}}</button>
                </span>
                <span v-else>{{nav[nav_index].name}}</span>
            </td>
            <td>{{item.expend}}/{{item.invest}}</td>
            <td>{{item.start}} / {{item.end}}</td>
            <td>{{item.address}}</td>
            <td><button class="btn btn-success btn-xs" v-on:click="clickAdmin(item.id)">管理</button></td>
            <td>
                <div class="btn-group btn-group-xs">
                    <a href="javascript:;" class="btn btn-primary" v-bind:data-id="item.id" data-href="{php echo $this->createWebUrl('edit')}" v-on:click="goDetail">详情</a>
                    <a herf="javascript:;" class="btn btn-danger" v-on:click="clickDel(item.id)">删除</a>
                </div>
            </td>
        </tr>
    </table>
    <h6 v-else style="font-size:30px;text-align: center;color:#ccc;">暂无数据</h6>
    <paging v-on:change-page="changePage" v-bind:total="total" v-bind:return-num="returnNum"></paging>

    <!--S核销地址、活动管理账号密码-->
    <modal name="admin-modal" id="admin-modal" height="350" v-on:before-open="beforeAdminModal" style="z-index:99999990;">
        <div class="form-group">
            <label>活动管理后台地址</label><br />
            <button class="btn btn-info btn-xs copy-admin-url" :data-clipboard-text="admin_url" v-on:click="copyAdmin">复制链接</button>
            <button class="btn btn-info btn-xs" v-on:click="goAdmin">直接打开</button>
        </div>
        <div class="form-group">
            <label>管理账号</label>
            <input type="text" v-model="account" class="form-control" placeholder="后台管理账号" />
        </div>
        <div class="form-group">
            <label>管理密码</label>
            <input type="password" v-model="password" class="form-control" placeholder="后台管理密码" />
        </div>
        <div class="form-group">
            <label>确认后台管理密码</label>
            <input type="password" v-model="confirm_password" class="form-control" placeholder="确认后台管理密码" />
        </div>
        <div class="button-div button-div-right"><button type="button" class="btn btn-danger" v-on:click="closeAdminModal">关闭</button></div>
        <div class="button-div"><button type="button" class="btn btn-primary" v-on:click="submitAdmin">确认</button></div>
    </modal>
    <!--E核销地址核、活动管理账号密码-->

    <v-dialog style="z-index:99999999;"/><!--提示框-->
</div>
<script src="../addons/kuyuan_vbz/dist/web/activity-list.js"></script>
{template 'common/footer'}
